﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using WFL.IoCUnity;

namespace WFL.RBAC
{
    public class ResourceBLL
    {
        private IResource _resource;

        public ResourceBLL()
        {
            _resource = UnityUtility.Resolve<IResource>();
        }

        public void Create(Resource item)
        {
            _resource.Create(item);
        }

        public void Delete(int id)
        {
            _resource.Delete(id);
        }

        public void Update(Resource item)
        {
            _resource.Update(item);
        }

        public IList<Resource> GetList(string name, int pageIndex, int pageSize)
        {
            return _resource.GetList(name, pageIndex, pageSize);
        }

        public Resource Get(int id)
        {
            return _resource.Get(id);
        }

        public Resource Get(string name)
        {
            return _resource.GetByName(name);
        }
    }
}
